<?php


// Simple index controller.
$context->set('indexController', array(
    'className' => 'halo_SimpleController',
    'properties' => array(
        'view' => 'index',
    ),
));


// Simple hello world controller.
$context->set('helloWorldController', array(
    'className' => 'halo_SimpleController',
    'properties' => array(
        'view' => 'helloWorld',
    ),
));


// Sample of a form controller.
$context->set('sampleFormController', array(
    'className' => 'examples_single_controller_Form',
    'constructorArgs' => array(
        'sampleDao' => $context->ref('sampleDao'),
        'formView' => 'sampleForm.showForm',
        'formSuccessView' => 'sampleForm.success',
        'formFailureView' => 'sampleForm.failure',
    )
));


//
// Setup a simple map from url ( sans leading / ) to
// context objects.
//
// $context->set(array(
//     'className' => 'halo_SimpleUrlHandlerMapping',
//     'lazyLoad' => false,
//     'constructorArgs' => array(
//         'default' => 'indexController',
//         'mappings' => array(
//             'index' => 'indexController',
//             'helloWorld' => 'helloWorldController',
//         ),
//     ),
// ));


// A slightly more complex mapping scheme that resembles
// Cake's routing. However, it can also behave in a very
// simple way, looking almost identical to the
// SimpleUrlHandlerMapping implementation.
$context->set(array(
    'className' => 'halo_CakelikeHandlerMapping',
    'constructorArgs' => array(
        'setup' => array(
            '/' => 'indexController',
            '/index' => 'indexController',
            '/helloWorld' => 'helloWorldController',
            '/sampleForm' => 'sampleFormController',
        ),
    ),
    'lazyLoad' => false,
));


//
// View defintions are located in a properties file, so we
// use a PropertiesConfigurationViewResolver to read view
// configuration information from a properties file.
//
// By default, 'views.properties' is the location of the views
// configuration file. Should be in classpath, but for
// consistency, it is recommended that it exists in conf/ .
$context->set(array(
    'className' => 'halo_PropertiesConfigurationViewResolver',
    'constructorArgs' => array(
        'locations' => array('views.properties', 'viewsSite.properties'),
    ),
    'lazyLoad' => false,
));

?>
